# Maintainer: Erik S. V. Jansson <caffeineviking@gmail.com>

pkgname=osgw-git
pkgver=VERSION
pkgrel=1
pkgdesc="Real-Time Ocean with Gerstner Wave"
arch=('i686' 'x86_64')
url="https://github.com/CaffeineViking/osgw"
license=('MIT')
provides=('osgw')
depends=('glfw' 'libpng')
makedepends=('git' 'premake-git')
source=('git+https://github.com/CaffeineViking/osgw')
md5sums=('SKIP')

pkgver() {
	cd osgw
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
	cd osgw
	make config=release
}

package() {
	cd osgw
	install -Dm755 bin/osgw "$pkgdir"/usr/bin/osgw
	install -Dm644 license.md "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
	install -Dm644 share/shaders/gerstner.frag "$pkgdir"/usr/share/osgw/shaders/gerstner.frag
	install -Dm644 share/shaders/gerstner.glsl "$pkgdir"/usr/share/osgw/shaders/gerstner.glsl
	install -Dm644 share/shaders/gerstner.tesc "$pkgdir"/usr/share/osgw/shaders/gerstner.tesc
	install -Dm644 share/shaders/gerstner.tese "$pkgdir"/usr/share/osgw/shaders/gerstner.tese
	install -Dm644 share/shaders/gerstner.vert "$pkgdir"/usr/share/osgw/shaders/gerstner.vert
	install -Dm644 share/shaders/lighting.glsl "$pkgdir"/usr/share/osgw/shaders/lighting.glsl
	install -Dm644 share/shaders/matrices.glsl "$pkgdir"/usr/share/osgw/shaders/matrices.glsl
	install -Dm644 share/shaders/textures.glsl "$pkgdir"/usr/share/osgw/shaders/textures.glsl
	install -Dm644 share/shaders/snoise3d.glsl "$pkgdir"/usr/share/osgw/shaders/snoise3d.glsl
	install -Dm644 share/images/wave_image.png "$pkgdir"/usr/share/osgw/images/wave_image.png
}
